﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace gdi
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            Graphics g = this.CreateGraphics();
            g.Clear(Color.White);
            Pen mypen = new Pen(Color.Red,3);
            g.DrawRectangle(mypen, 0, 0, 200, 100);
            g.DrawEllipse(mypen,0,0,200,100);
            g.Dispose();
            mypen.Dispose();

        }

        private void button1_Click(object sender, EventArgs e)
        {
            Graphics g = this.CreateGraphics();
            g.Clear(Color.White);
            Pen mypen = new Pen(Color.Red, 3);
            g.TranslateTransform(0,120);
            g.DrawRectangle(mypen, 0, 0, 200, 100);
           g.DrawEllipse(mypen, 0, 0, 200, 100);
            g.Dispose();
            mypen.Dispose();

        }

      

        private void button2_Click(object sender, EventArgs e)
        {
            Graphics g = this.CreateGraphics();
            g.Clear(Color.White);
            Pen mypen = new Pen(Color.Red, 3);
            g.ScaleTransform(1, 2);
            g.DrawRectangle(mypen, 0, 0, 200, 100);
            g.DrawEllipse(mypen, 0, 0, 200, 100);
            g.Dispose();
            mypen.Dispose();

        }
    }
}
